<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>背景颜色</title>
    <style>
        div {
            background-color: #0f0;
            border: 10px dotted #000;
            width: 400px;
            height: 100px;
            /* 内边距 */
            padding: 10px;
        }

        .div1 {
            background-clip: border-box;
        }

        .div2 {
            background-clip: content-box;
        }

        .div3 {
            background-clip: padding-box;
        }
    </style>
</head>
<body>
    <div class="div1">div1：background-clip: border-box;<br>这个是默认值。背景绘制区域包含边框。</div>
    <div class="div2">div2：background-clip: content-box;<br>背景绘制区域只包含内容。</div>
    <div class="div3">div3：background-clip: padding-box;<br>背景绘制区域只包含内边距和内容。</div>
</body>
</html>